// this is for setting of the birthday option
function editBirthdayOption(){
	
	var birth_month=document.getElementById("birth_month");
	var birth_year=document.getElementById("birth_year");
	var birth_day=document.getElementById("birth_day");
	
	var selectedYear=birth_year[birth_year.selectedIndex].value;
	var selectedMonth=birth_month[birth_month.selectedIndex].value;
	
	if(selectedMonth==-1||selectedMonth==1||selectedMonth==3||selectedMonth==5||selectedMonth==7||selectedMonth==8||
		selectedMonth==10||selectedMonth==12){
		if(birth_day.length<32){
			for(var i=birth_day.length;i<=31;i++){
				var new_day=document.createElement('option');
				new_day.value=i;
				new_day.text=i;
				try {							
					birth_day.add(new_day, null); // for standards compliant;
				}catch(ex) {
					birth_day.add(new_day); // for IE
				}
			}
		}		
	}else if(selectedMonth==2){
		if(selectedYear%4==0){
			if(birth_day.length>30){
				for(var i=birth_day.length-1;i>29;i--){
					birth_day.remove(i);
				}
			}else if(birth_day.length<30){
				for(var i=birth_day.length;i<=29;i++){
					var new_day=document.createElement('option');
					new_day.value=i;
					new_day.text=i;
					try {							
						birth_day.add(new_day, null); // for standards compliant;
					}catch(ex) {
						birth_day.add(new_day); // for IE
					}
				}
			}	
		}else{
			if(birth_day.length>29){
				for(var i=birth_day.length-1;i>28;i--){
					birth_day.remove(i);
				}
			}
		}
	}else{
		if(birth_day.length>31){
			for(var i=birth_day.length-1;i>30;i--){
				birth_day.remove(i);
			}
		}else if(birth_day.length<31){
			for(var i=birth_day.length;i<=30;i++){
				var new_day=document.createElement('option');
				new_day.value=i;
				new_day.text=i;
				try {							
					birth_day.add(new_day, null); // for standards compliant;
				}catch(ex) {
					birth_day.add(new_day); // for IE
				}
			}
		}	
	}	
}